package cn.xiaolang.function.timerVSquartz;


public class RuntimeDemo {

	public static void main(String[] args) {
		//虚拟机关闭时的动作，一般释放某些资源
//		Runtime.getRuntime().addShutdownHook(new Thread(){
//			@Override
//			public void run() {
//   				super.run();
//			}
//		});
		int a = 1;
		int b = 2;
		System.out.println("对象a经过hashCode()后的结果："+System.identityHashCode(a));
		System.out.println("对象b经过hashCode()的结果："+System.identityHashCode(b));
		System.out.println("当前JVM的空闲内存："+Runtime.getRuntime().freeMemory());
		System.gc();
		System.out.println("被gc回收之后的JVM空闲内存："+Runtime.getRuntime().freeMemory());
	}
}
